package com.travel.controller.user;

import com.travel.constant.ApiConstants;
import com.travel.model.dto.comment.CommentRequest;
import com.travel.model.dto.common.ApiResponse;
import com.travel.model.entity.content.Comment;
import com.travel.service.Service.DestinationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
//用户目的地接口 , 添加目的地评论
@Tag(name = "用户目的地", description = "用户目的地相关接口")
@RestController
@RequestMapping(ApiConstants.API_USER + "/destinations")
@RequiredArgsConstructor
public class UserDestinationController {
    
    private final DestinationService destinationService;

    @Operation(summary = "添加目的地评论")
    @PostMapping("/{destinationId}/comments")
    public ApiResponse<Comment> addComment(
        @Parameter(description = "目的地ID") @PathVariable Long destinationId,
        @Valid @RequestBody CommentRequest request) {
        return ApiResponse.success(destinationService.addComment(destinationId, request));
    }
} 